import request from '@/utils/request'

export default {
  //1.讲师列表(条件查询分页)
  //current 当前页 limit每页记录数  teacherQuery条件对象
  getTeacherListPage(current, limit, teacherQuery) {
    return request({
      //后端的地址
      url: `/eduservice/edu-teacher/pageTeacherCondition/${current}/${limit}`,
      //这里用的是es6的``不是单引号
      method: 'post',//method提交方式
      //teacherQuery条件对象，后端使用RequestBody获取数据
      //data表示把对象转换json进行传递到接口
      data: teacherQuery
    })
  },
  //2.删除讲师
  deleteTeacherById(id) {
    return request({
      url: `/eduservice/edu-teacher/${id}`,
      method: 'delete',

    })
  },
  //3.添加讲师
  addTeacher(teacher) {
    return request({
      url: '/eduservice/edu-teacher/addTeacher',
      method: 'post',
      //teacher条件对象，后端使用RequestBody获取数据
      //data表示把对象转换json进行传递到接口
      data: teacher
    })
  },
  //3.1添加讲师表单页面实现数据回显
  getTeacherInfoById(id) {
    return request({
      url: `/eduservice/edu-teacher/getTeacher/${id}`,
      method: 'get',
    })
  },
  //修改讲师
  updateTeacher(teacher) {
    return request({
      url: '/eduservice/edu-teacher/updateTeacher',
      method: 'put',
      data: teacher
    })
  },



}

